/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.totoland.db.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Objects;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author totoland
 */
@Entity
@Table(name = "StudentInfo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "StudentInfo.findAll", query = "SELECT s FROM StudentInfo s")})
public class StudentInfo implements Serializable {
    private static final long serialVersionUID = 5496946460699475047L;
    
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @Column(name = "StudentID")
    private BigDecimal studentID;
    @Column(name = "Prefix")
    private String prefix;
    @Column(name = "FName")
    private String fName;
    @Column(name = "LName")
    private String lName;
    @Column(name = "ClassName")
    private String className;
    @Column(name = "FacultyName")
    private String facultyName;
    @Column(name = "MajorName")
    private String majorName;
    @Column(name = "Exp")
    @Temporal(TemporalType.TIMESTAMP)
    private Date exp;
    @Column(name = "ImagePath")
    private String imagePath;
    @Column(name = "CreateDateTime")
    @Temporal(javax.persistence.TemporalType.TIMESTAMP)
    private Date createDateTime;
    @Column(name = "CreateBy")
    private Integer createBy;

    public StudentInfo() {
        this.createDateTime = new Date();
    }

    public StudentInfo(BigDecimal studentID) {
        this.studentID = studentID;
    }

    public BigDecimal getStudentID() {
        return studentID;
    }

    public void setStudentID(BigDecimal studentID) {
        this.studentID = studentID;
    }

    public String getPrefix() {
        return prefix;
    }

    public void setPrefix(String prefix) {
        this.prefix = prefix;
    }

    public String getFName() {
        return fName;
    }

    public void setFName(String fName) {
        this.fName = fName;
    }

    public String getLName() {
        return lName;
    }

    public void setLName(String lName) {
        this.lName = lName;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getFacultyName() {
        return facultyName;
    }

    public void setFacultyName(String facultyName) {
        this.facultyName = facultyName;
    }

    public String getMajorName() {
        return majorName;
    }

    public void setMajorName(String majorName) {
        this.majorName = majorName;
    }

    public Date getExp() {
        return exp;
    }

    public void setExp(Date exp) {
        this.exp = exp;
    }

    public String getImagePath() {
        return imagePath;
    }

    public void setImagePath(String imagePath) {
        this.imagePath = imagePath;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (studentID != null ? studentID.hashCode() : 0);
        return hash;
    }

    /**
     * @return the createDateTime
     */
    public Date getCreateDateTime() {
        return createDateTime;
    }

    /**
     * @param createDateTime the createDateTime to set
     */
    public void setCreateDateTime(Date createDateTime) {
        this.createDateTime = createDateTime;
    }

    /**
     * @return the createBy
     */
    public Integer getCreateBy() {
        return createBy;
    }

    /**
     * @param createBy the createBy to set
     */
    public void setCreateBy(Integer createBy) {
        this.createBy = createBy;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final StudentInfo other = (StudentInfo) obj;
        if (!Objects.equals(this.studentID, other.studentID)) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "StudentInfo{" + "studentID=" + studentID + ", prefix=" + prefix + ", fName=" + fName + ", lName=" + lName + ", className=" + className + ", facultyName=" + facultyName + ", majorName=" + majorName + ", exp=" + exp + ", imagePath=" + imagePath + ", createDateTime=" + createDateTime + ", createBy=" + createBy + '}';
    }
}
